<#list frontMsgDefinitions as def>
   import ${def.name}Script from "./${def.package_name}/${def.name}Script"
</#list>


export default class MsgScriptManager{

    private id2Msg:${"Map<number,any>"} = new Map();

    private static  _instance = new MsgScriptManager()
    private constructor(){
        this.loadAllScripts()
    }

    public static get instance(){
        return MsgScriptManager._instance
    }
    getMsgScript(msgId:number){
        return this.id2Msg.get(msgId)
    }

    loadAllScripts(){
<#list frontMsgDefinitions as def>
        this.id2Msg.set(${def.msgId?c},${def.name}Script)
</#list>
    }
}
